get:
  summary: List Roles
  description: List the roles.
  operationId: getRoles
  parameters:
    - $ref: '../../openapi.yaml#/components/parameters/Fields'
    - $ref: '../../openapi.yaml#/components/parameters/Limit'
    - $ref: '../../openapi.yaml#/components/parameters/Offset'

    - $ref: '../../openapi.yaml#/components/parameters/Meta'
    - $ref: '../../openapi.yaml#/components/parameters/Sort'
    - $ref: '../../openapi.yaml#/components/parameters/Filter'
    - $ref: '../../openapi.yaml#/components/parameters/Search'
    - $ref: '../../openapi.yaml#/components/parameters/Page'
  responses:
    '200':
      description: Successful request
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type: array
                items:
                  $ref: '../../openapi.yaml#/components/schemas/Roles'
              meta:
                $ref: '../../openapi.yaml#/components/schemas/x-metadata'
    '401':
      $ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
    '404':
      $ref: '../../openapi.yaml#/components/responses/NotFoundError'
  tags:
    - Roles

post:
  summary: Create a Role
  description: Create a new role.
  operationId: createRole
  parameters:
    - $ref: '../../openapi.yaml#/components/parameters/Fields'
    - $ref: '../../openapi.yaml#/components/parameters/Meta'
  requestBody:
    content:
      application/json:
        schema:
          properties:
            description:
              description: Description of the role.
              type: string
            enforce_tfa:
              description: Whether or not this role enforces the use of 2FA.
              type: boolean
            external_id:
              description: ID used with external services in SCIM.
              type: string
            ip_access:
              description: Array of IP addresses that are allowed to connect to the API as a user of this role.
              type: array
              items:
                type: string
            module_listing:
              description: Custom override for the admin app module bar navigation.
              type: string
            name:
              description: Name of the role.
              type: string
              example: Interns
          type: object
  responses:
    '200':
      description: Successful request
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: '../../openapi.yaml#/components/schemas/Roles'
    '401':
      $ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
    '404':
      $ref: '../../openapi.yaml#/components/responses/NotFoundError'
  tags:
    - Roles

patch:
  summary: Update Multiple Roles
  description: Update multiple roles at the same time.
  tags:
    - Roles
  operationId: updateRoles
  parameters:
    - $ref: '../../openapi.yaml#/components/parameters/Fields'
    - $ref: '../../openapi.yaml#/components/parameters/Limit'
    - $ref: '../../openapi.yaml#/components/parameters/Meta'
    - $ref: '../../openapi.yaml#/components/parameters/Offset'

    - $ref: '../../openapi.yaml#/components/parameters/Sort'
    - $ref: '../../openapi.yaml#/components/parameters/Filter'
    - $ref: '../../openapi.yaml#/components/parameters/Search'
  requestBody:
    content:
      application/json:
        schema:
          properties:
            keys:
              type: array
              items:
                type: string
            data:
              type: object
              properties:
                description:
                  description: Description of the role.
                  type: string
                enforce_tfa:
                  description: Whether or not this role enforces the use of 2FA.
                  type: boolean
                external_id:
                  description: ID used with external services in SCIM.
                  type: string
                ip_access:
                  description: Array of IP addresses that are allowed to connect to the API as a user of this role.
                  type: array
                  items:
                    type: string
                module_listing:
                  description: Custom override for the admin app module bar navigation.
                  type: string
                name:
                  description: Name of the role.
                  type: string
                  example: Interns
          type: object

  responses:
    '200':
      description: Successful request
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type: array
                items:
                  $ref: '../../openapi.yaml#/components/schemas/Roles'
              meta:
                $ref: '../../openapi.yaml#/components/schemas/x-metadata'
    '401':
      $ref: '../../openapi.yaml#/components/responses/UnauthorizedError'

delete:
  summary: Delete Multiple Roles
  description: Delete multiple existing roles.
  tags:
    - Roles
  operationId: deleteRoles
  responses:
    '200':
      description: Successful request
    '401':
      $ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
